const BASE_URL = 'http://localhost:3000/api';

// 登录
const login = (username, password) => {
  return new Promise((resolve, reject) => {
    wx.request({
      url: `${BASE_URL}/login`,
      method: 'POST',
      data: {
        username,
        password
      },
      success: (res) => {
        resolve(res.data);
      },
      fail: (err) => {
        reject(err);
      }
    });
  });
};

module.exports = {
  login
}; 